<template>
	<view>
		<!-- 头像 -->
		<view class="head">
			<view class="head-left">
				<image :src="listdata.icon" mode=""></image>
				<text>{{listdata.name}}</text>
			</view>
			<view class="head-right">
				<image :src="listdata.AD" mode=""></image>
			</view>
		</view>
		<view class="line"></view>
		<view class="sidebar">
			<view class="sidebar-link" v-for="item in listdata.listdata" :key="item.id">
				<image :src="item.AD" mode=""></image>
				<text class="row">{{item.user}}</text>
				<text class="arrows">></text>
			</view>
			<view class="line"></view>
			<view class="sidebar-link">
				<image :src="listdata.AD1" mode=""></image>
				<text class="row">{{listdata.user}}</text>
				<text class="arrows">></text>
			</view>
			<view class="line"></view>
			<view class="sidebar-link" v-for="item in listdata.listinfo" :key="item.id+2">
				<image :src="item.AD" mode=""></image>
				<text class="row">{{item.user}}</text>
				<text class="arrows">></text>
			</view>
			<view class="line-link"></view>
		</view>
	</view>
</template>

<script>
	import axios from "../../bower_components/axios/dist/axios.js";
	export default {
		data() {
			return {
				listdata: [],
			};
		},
		onLoad() {
			this.getdata()
		},
		methods: {
			getdata() {
				// 用axios 获取数据
				axios.get("/user/data").then((res) => {
					this.listdata = res.data.data
				});
			},
		}
	}
</script>

<style lang="scss">
	// 头像
	.head {
		height: 170rpx;
		padding: 0 40rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;

		.head-left {
			width: 220rpx;
			height: 100rpx;
			display: flex;
			justify-content: space-around;
			align-items: center;

			image {
				flex: 1;
				margin-right: 20rpx;
				width: 100%;
				height: 100%;
			}
		}

		.head-right {
			width: 240rpx;
			height: 80rpx;

			image {
				width: 100%;
				height: 100%;
			}
		}
	}

	.line {
		height: 20rpx;
		background-color: #f3f3f3;
	}

	.sidebar {
		// padding: 0 ;

		.sidebar-link {
			padding: 10rpx 20rpx;
			height: 100rpx;
			display: flex;
			align-items: center;
			position: relative;

			image {
				width: 8%;
				height: 60%;
			}

			.row {
				margin-left: 20rpx;
				font-size: 36rpx;
			}

			.arrows {
				position: absolute;
				right: 20rpx;
			}
		}

		.line-link {
			height: 3rpx;
			width: 94%;
			margin-left: 30px;
			background-color: #ececec;
		}
	}
</style>
